package com.kly.enums;

public enum ProviderEnum {
    GOOGLE(1, "google"),

    ITNIO_TECH(2,"itnioTech"),

    NXY(3,"NXY"),
    ;

    private Integer code;

    private String desc;

    ProviderEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static ProviderEnum getByCode(Integer code) {
        ProviderEnum[] enumps = ProviderEnum.values();
        for (ProviderEnum providerEnum : enumps) {
            if (providerEnum.getCode().equals(code)) {
                return providerEnum;
            }
        }
        return null;
    }
}
